<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html>
<html lang="fr">
<head>
    <meta http-equiv="content-type" content="text/html; charset=UTF-8">
    <title>eNewStore</title>

    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <link rel="stylesheet" href="<c:url value="/assets/css/bootstrap.css" />">

    <link rel="stylesheet" href="<c:url value="/assets/css/global.css"/>">

    <%--<link  rel="stylesheet" href="<c:url value="/assets/css/listeCommande.css"/>">--%>

</head>

<!-- HTML code from Bootply.com editor -->

<body>

<jsp:include page="../Menu_template/menuHeader.jsp"/>

<!-- Main -->
<div class="container">

    <!-- upper section -->
    <div class="row">
        <div class="col-md-3">
            <!-- left -->
            <a href="/login_Prepa_mobile"><strong><i class="glyphicon glyphicon-briefcase"></i> Service
                Préparation</strong></a>
            <hr>
            <%--<ul class="nav nav-pills nav-stacked">--%>
            <%--<li><a href="#"><i class="glyphicon glyphicon-flash"></i> Liste Commandes</a></li>--%>
            <%--<li><a href="#"><i class="glyphicon glyphicon-list-alt"></i> Commande en cours</a></li>--%>
            <%--</ul>--%>
            <hr>
        </div>
        <!-- /span-3 -->
        <div class="col-md-9">

            <!-- column 2 -->
            <a href="/dashboardPrepa"><strong><i class="glyphicon glyphicon-dashboard"></i> Liste Commandes</strong></a>
            <hr>
            <div class="row">
                <!-- center left-->
                <div class="col-md-7">
                    <div class="panel panel-default" style="width: 210%">
                        <div class="panel-heading">
                            <h4>Gestion commandes/Palettes</h4>
                        </div>
                        <div class="panel-body">

                        <form class="form-signin" role="form"  action="/commandeTest.jsp" method="GET">
                            <h2>Ma commande:${sRefCmd}</h2>

                            <h3>Allee: ${nomEmplacement.iAllee} - Rang: ${nomEmplacement.iRang}</h3>

                            <div class="table-responsive">
                                 <c:forEach var="commandePrepa" items="${lstCmdInPrepa}">
                                     <table id="table_principale" class="table table-bordered table-hover tableperso">
                                        <tr>
                                            <th>IDArticle</th>
                                            <th>Reference Article</th>
                                            <th>Designation</th>
                                            <th>Categorie</th>
                                            <th>Quantité</th>
                                            <th>Montant HT</th>
                                            <th>TVA</th>
                                            <th>Montant TTC</th>
                                            <th>Hypermarché</th>

                                        </tr>
                                        <tr>
                                            <td> ${commandePrepa.eIDArticle}</td>
                                            <td> ${commandePrepa.sRefArticle}</td>
                                            <td> ${commandePrepa.sLibelleArt}</td>
                                            <td> ${commandePrepa.sSousCatArt}</td>
                                            <td> ${commandePrepa.eQuantiteArt}</td>
                                            <td> ${commandePrepa.fMontantHT}</td>
                                            <td> ${commandePrepa.fTVA}</td>
                                            <td> ${commandePrepa.fMontantTTC}</td>
                                            <td> ${commandePrepa.sNomHypermarche}</td>

                                            <table id="Liste_Palette" class="table table-striped table-bordered" style="width: 100%; margin-left:20px">
                                                <thead>
                                                    <tr>
                                                        <th>Nom Fournisseur</th>
                                                        <th>Emplacement Produit</th>
                                                        <th>Nombre palettes</th>
                                                        <th>Nombre d'articles/palette</th>
                                                        <th>NbCartonParPalettes</th>
                                                        <th>Quantité totales</th>
                                                        <th>Quantité totales</th>

                                                    </tr>
                                                </thead>
                                                <!--Affiche les palettes par article -->
                                                <c:forEach var="lstPal" items="${lstPaletteByCmd}">

                                                   <c:if test="${commandePrepa.eIDArticle == lstPal.key}">
                                                        <tbody>
                                                        <c:forEach var="lstPal2" items="${lstPal.value}">

                                                            <tr>
                                                                <td> ${lstPal2.sNomFournisseur} </td>
                                                                <td> ${lstPal2.sEmplacementProduit} </td>
                                                                <td> ${lstPal2.eNbPaletteZoneStock} </td>
                                                                <td> ${lstPal2.eNbArticleParPalette} </td>
                                                                <td> ${lstPal2.eNbCartonParPalette} </td>
                                                                <td> ${lstPal2.eNbArticleParCarton} </td>
                                                                <td> ${lstPal2.eQteTotaleArticles} </td>
                                                                <td>${lstPal2.eNbPalettesChoisies}</td>

                                                            </tr>


                                                        </c:forEach>
                                                        </tbody>
                                                   </c:if>

                                                </c:forEach>
                                            </table>
                                        </tr>
                                     </table>
                                </c:forEach>
                            </div>

                        </div>
                        <!--/panel-body-->

                        </form>

                    </div>
                    <!--/panel-->
                </div>
                <!--/col-->
            </div>


            <script type='text/javascript'
                    src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>


            <script type='text/javascript'
                    src="//netdna.bootstrapcdn.com/bootstrap/3.0.0/js/bootstrap.min.js"></script>

        </div>
    </div>
</div>
</body>
</html>